//
//  ReDetailTableViewCell.m
//  海角音乐
//
//  Created by dllo on 15/8/7.
//  Copyright (c) 2015年 杨元石. All rights reserved.
//

#import "ReDetailTableViewCell.h"

@implementation ReDetailTableViewCell


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        
        self.backgroundColor = [UIColor clearColor];
        self.textLabel.textColor = [UIColor whiteColor];
        
        [self setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
        
        CGFloat X = SCREEN_WIDTH*0.1333333;//50
        CGFloat height =SCREEN_WIDTH*0.08; // 30
        
        self.song_name = [[UILabel alloc] initWithFrame:CGRectMake(X, 10, 250, height)];
        self.song_name.font = [UIFont boldSystemFontOfSize:17];
        self.song_name.textColor = [UIColor whiteColor];
        [self.contentView addSubview:self.song_name];
        [_song_name release];
        
        CGFloat Y = SCREEN_WIDTH*0.10666666; // 40
        CGFloat singer_name = SCREEN_WIDTH*0.66666667; // 250
        
        self.singer_name = [[UILabel alloc] initWithFrame:CGRectMake(X, Y, singer_name, height)];
        self.singer_name.font = [UIFont systemFontOfSize:13];
        self.singer_name.textColor = [UIColor whiteColor];
        [self.contentView addSubview:self.singer_name];
        [_singer_name release];
            
        CGFloat button_X = SCREEN_WIDTH*0.773333333; // 290
        CGFloat button_Y = SCREEN_WIDTH*0.05333333; // 20
        CGFloat button_width = SCREEN_WIDTH*0.1333333; // 50
        
        _button = [UIButton buttonWithType:UIButtonTypeCustom];
        _button.frame = CGRectMake(button_X, button_Y, button_width, button_width);
        [_button addTarget:self action:@selector(buttonAct) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:_button];


        [_song_name release];
        [_singer_name release];
    }
    
    return self;
    
}


- (void)getDataForCell:(ReDetailModel *)reDetailModel
{
    
    if (reDetailModel.singerName) {
        self.singer_name.text = reDetailModel.singerName;
        self.song_name.text = reDetailModel.name;
    } else {
        self.singer_name.text = reDetailModel.singer_name;
        self.song_name.text = reDetailModel.song_name;
    }    
}






- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
